package com.casstime.ec.cloud.discount.dao.amount;

import java.math.BigDecimal;
import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.casstime.ec.cloud.dao.jpa.mybatis.Mapper;
import com.casstime.ec.cloud.discount.model.AmountOrderInfo;
import com.casstime.ec.cloud.values.amountPromotion.AmountPromotion;
import com.casstime.ec.cloud.values.amountPromotion.AmountPromotionRequest;
/**
 * ClassName: AfterSalesPolicyMapper 
 * Function: (价格促销实体查询DAO)
 * Reason: ADD REASON(可选).
 *  
 * @author wu.chen 
 * 2018年1月30日 上午11:17:38
 * @version   
 * @since JDK 1.8
 */
@SuppressWarnings("rawtypes")
public interface AmountPromotionMapper extends Mapper {
	
	int insertOrUpdateAmountPromotion(@Param("promotion") AmountPromotion promotion);
	
	int addAmountPromotionAmount(@Param("promotionId") String promotionId, @Param("amount") BigDecimal amount);
	
	List<AmountPromotion> listAvailableAmountPromotions(
			@Param("productStoreIds") List<String> productStoreIds, @Param("platform") String platform);

	AmountPromotion findAmountPromotionById(@Param("promotionId") String promotionId);
	
	int deleteAmountPromotionById(@Param("promotionId")String promotionId);
	
	List<AmountPromotion> listAmountPromotionStoreId(@Param("productStoreId") String productStoreId,
			@Param("request") AmountPromotionRequest request);
	
	List<AmountPromotion> listValidAmountPromotionStoreId(@Param("productStoreId") String productStoreId,
			@Param("request") AmountPromotionRequest request);

	int updateAmountPromotionStatus(@Param("promotionId") String promotionId, @Param("status") String status);
	
	/**
	 * 
	 * findAmountOrderInfo:(满减活动计算订单量和实际满减总数).<br/>    
	 * @param productStoreIds
	 * @return
	 * @author hongcheng.wu
	 * @date 2018年3月22日 下午3:24:34
	 */
	List<AmountOrderInfo> findAmountOrderInfo(@Param("promotionIds") List<String> promotionIds);
	
}
